package tn.orange.canreminder;

import android.accounts.Account;
import android.accounts.AccountManager;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.PreferenceActivity;
import android.view.KeyEvent;

public class ConfigActivity extends PreferenceActivity {
	private ListPreference listPreference;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferences);
		listPreference = (ListPreference) findPreference("listPref");
		Account[] accounts = AccountManager.get(this).getAccounts();
		String[] emails = new String[accounts.length];
		int i = 0;
		for (Account account : accounts) {
			emails[i] = account.name;
			i++;
		}

		listPreference.setEntries(emails);
		listPreference.setEntryValues(emails);
	}

}
